﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RentAWorker.DataAccess.Interfaces;
using RentAWorker.DataAccess;

namespace RentAWorker.Business.Impl.Util
{
    public static class DataAccessFactory
    {
        private static bool UseDummy = false;

        public static ICustomerAccess GetCustomerAccess()
        {
            if (UseDummy)
            {
                return new DataAccessDummy();
            }
            else
            {
                return new CustomerDataAccess();
            }
        }

        public static ILocationAccess GetLocationAccess()
        {
            if (UseDummy)
            {
                return new DataAccessDummy();
            }
            else
            {
                return new LocationDataAccess();
            }
        }

        public static IMachineTypeAccess GetMachineTypeAccess()
        {
            if (UseDummy)
            {
                return new DataAccessDummy();
            }
            else
            {
                return new MachineTypeDataAccess();
            }
        }

        public static IRentalServiceAccess GetRentalServiceAccess()
        {
            if (UseDummy)
            {
                return new DataAccessDummy();
            }
            else
            {
                return new RentalServiceDataAccess();
            }
        }

        public static IResourceAccess GetResourceAccess()
        {
            if (UseDummy)
            {
                return new DataAccessDummy();
            }
            else
            {
                return new ResourceDataAccess();
            }
        }
    }
}
